<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="../../lib/jquery-3.4.1.js"></script>
</head>
<body>
    <script>
        // 回调地狱
    var baseUrl='https://music.aityp.com/';
    $.ajax({
        url:baseUrl+'top/playlist',
        type:"get",
        data:{
            cat:'华语'
        },
        dataType:"json",
        success:res=>{
            var {playlists}=res;
            var item=playlists[0];
            console.log(item);
            $.ajax({
                url:`${baseUrl}playlist/detail?id=${item.id}`,
                type:"get",
                success:res=>{
                    console.log(res.playlist.trackIds[0].id)
                    let id=res.playlist.trackIds[0].id;
                    $.ajax({
                        url:`${baseUrl}song/url?id=${id}`,
                        success:res=>{
                            console.log(res)
                        }
                    })
                }
            })
        }
            })
    </script>
</body>
</html>